import type { App } from 'vue'
import writer from './modules/writer'
import scrollToBottom from './modules/scrollToBottom'
import drag from './modules/drag'

const directivesList: any = {
  writer,
  scrollToBottom,
  drag
}

const directives = {
  install: function (app: App<Element>) {
    Object.keys(directivesList).forEach((key) => {
      // 注册自定义指令
      app.directive(key, directivesList[key])
    })
  }
}
export default directives
